package org.s3.project.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Mapper;
import org.s3.project.entity.Orders;
import org.s3.project.mapper.OrdersMapper;
import org.s3.project.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import java.util.List;

/**
 * @author cfx
 * @version 1.0
 * @Description
 * @date 2025/2/9 10:25
 */
@Service
public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, Orders> implements OrdersService {
    @Autowired
    private OrdersMapper ordersMapper;

    @Override
    public List<Orders> getOrdersByUserId(int merchant_id) {
        return ordersMapper.getOrdersByUserId(merchant_id);
    }

    @Override
    public int updateStatus(Orders orders) {
        return ordersMapper.updateStatus(orders);
    }

    @Override
    public List<Orders> getTodayOrders(int merchant_id) {
        return ordersMapper.getTodayOrders(merchant_id);
    }

    @Override
    public int cancelOrder(Integer id) {
        return ordersMapper.deleteById(id);
    }

    @Override
    public List<Orders> selectMerchantMonthSalesDetail(int merchant_id) {
        return ordersMapper.selectMerchantMonthSalesDetail(merchant_id);
    }
    @Autowired
    private OrdersMapper ordersMapper;
    @Override
    public Boolean updState(String outTradeNo) {

        return ordersMapper.updState(outTradeNo);
    }

    @Override
    public Orders getByOrdersNumber(String ordersNumber) {
        return ordersMapper.getByOrdersNumber( ordersNumber );
    }
    @Override
    public List<Orders> getOrdersByUserId(int merchant_id) {
        return ordersMapper.getOrdersByUserId(merchant_id);
    }

    @Override
    public int updateStatus(int status, int merchant_id) {
        return ordersMapper.updateStatus(status, merchant_id);
    }

    @Override
    public List<Orders> getTodayOrders(int merchant_id) {
        return ordersMapper.getTodayOrders(merchant_id);
    }

    @Override
    public List<Orders>selectOrders(int id) {
        return ordersMapper.selectOrders(id);
    }
    @Override
    public Boolean updatepinglun(@Param("od") String od){
        return  ordersMapper.updatepinglun(od);
    }
    @Override
    public List<Orders> ShowEvaluate(int id) {
        return ordersMapper.ShowEvaluate(id);
    }

    // 退款
    @Override
    public Boolean refundOrder(List<Orders> orders) {
        return ordersMapper.refundOrder(orders);
    }

    //新增退款原因
    @Override
    public Boolean addOrders() {
        return ordersMapper.addOrders();
    }

    @Override
    public Boolean insertOrdersBy(Orders orders) {
        return ordersMapper.insertOrdersBy(orders);
    }
//退款
    @Override
    public Boolean Tuikuan(String oid,String refund_reason) {

        return ordersMapper.Tuikuan(oid,refund_reason);
    }

    @Override
    public List<Orders> ShowTuiKuan(int id) {
        return ordersMapper.ShowTuiKuan(id);
    }

    @Override
    public List<Orders> ShowProgress(int id) {
        return ordersMapper.ShowProgress(id);
    }

    @Override
    public Boolean cancelOrder(String cancel_reason, int id) {
        return ordersMapper.cancelOrder(cancel_reason,id);
    }

}
